﻿using System;
using CommunityToolkit.Mvvm.ComponentModel;
using UI.ViewModels;

namespace UI.Models;

public partial class PlcInfoVariable : ViewModelBase
{
    [ObservableProperty] private bool _isSelected;//是否选中
    [ObservableProperty] private int _id;
    [ObservableProperty] private int _seria;
    [ObservableProperty] private string _name;
    [ObservableProperty] private DateTime _createdDate;
    [ObservableProperty] private DateTime _modifiedDate;
    [ObservableProperty] private string _variableAddress;
    [ObservableProperty] private string _variableName;
    [ObservableProperty] private string _accessType;
    [ObservableProperty] private int _interval;
    [ObservableProperty] private string _dataAcquisitionType;//数据采集模式  
    [ObservableProperty] private string _group;

    public PlcInfoVariable() { }

    public PlcInfoVariable(int id, int seria, string name, DateTime createdDate, DateTime modifiedDate, string variableAddress, string variableName, string accessType, int interval, string dataAcquisitionType, string group, bool isSelected)
    {
        _id = id;
        _seria = seria;
        _name = name;
        _createdDate = createdDate;
        _modifiedDate = modifiedDate;
        _variableAddress = variableAddress;
        _variableName = variableName;
        _accessType = accessType;
        _interval = interval;
        _dataAcquisitionType = dataAcquisitionType;
        _group = group;
        _isSelected = isSelected;
    }
}